package com.yitiao.demo.singleton;

public class EnumStarvingSingleton {

    private EnumStarvingSingleton(){}

    public static EnumStarvingSingleton getInstance(){
        return ContainerHolder.HOLDER.instance;
    }
    private enum ContainerHolder{
        HOLDER;

        private EnumStarvingSingleton instance;

        ContainerHolder(){
            instance = new EnumStarvingSingleton();
        }
    }
}
